<%if session[:admin]%>
<h1>Editing location</h1>

<% form_for(@location) do |f| %>
  <%= f.error_messages %>

  <p>
    <%= f.label :username %><br />
    <%= f.text_field :username %>
  </p>
  <p>
    <%= f.label :phonenumber %><br />
    <%= f.text_field :phonenumber %>
  </p>
  <p>
    <%= f.label :latitude %><br />
    <%= f.text_field :latitude %>
  </p>
  <p>
    <%= f.label :longitude %><br />
    <%= f.text_field :longitude %>
  </p>
   <p>
    <%= f.label :time %><br />
    <%= f.datetime_select :time %>
  </p>
  <p>
    <%= f.label :commType %><br />
    <%= f.text_field :commType %>
  </p>
  <p>
    <%= f.submit 'Update' %>
  </p>
<% end %>

<%= link_to 'Show', @location %> 
<%end%>
<%= link_to 'Back', locations_path %>
